import axios from "axios";

import NProgress from 'nprogress'
import 'nprogress/nprogress.css'

const axios_children = axios.create({
    baseURL:'/api',
    timeout:15000
})
// axios.defaults.baseURL='/api';
// axios.defaults.timeout=15000;


axios_children.interceptors.request.use(function (config) {
    NProgress.start()
    return config;
});

axios_children.interceptors.response.use(function (response) {
    NProgress.done()
    return response.data;

}, function (error) {

    NProgress.done()
    return Promise.reject(error);
});

export default axios_children;